package edu.pku.sei.gefcommon.descriptor.descriptors;

import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;

public class BooleanPropertyDescriptor extends ComboBoxPropertyDescriptor {
	final private static String[] STRINGS = new String[]{"false","true"};
	public BooleanPropertyDescriptor(Object id, String name,String catalog) {
		super(id, name,STRINGS);
		this.setCategory(catalog);
	}
	
	static public Integer fromModel(Boolean value){
		if(value) return 1;
		else return 0;
	}
	static public Boolean toModel(Integer value){
		if(value==1) return true;
		else return false;
	}
}
